import { AxiosPromise } from "axios"
import request from "@mars/common/api/http"
import { NoiseInfoVO, OssVO } from "./type"

/**
 * 获取街道列表
 * @param id
 */
export const streetList = (query?: any) => {
  return request({
    url: "/dp/street/list",
    method: "get",
    params: query
  })
}

/**
 * 监测站点数据
 */
export const noiseList = () : AxiosPromise<NoiseInfoVO> => {
  return request({
    url: "/dp/noise/list",
    method: "get"
  })
}

/**
 * 设备接口
 * @param id
 */
export const deviceList = () => {
  return request({
    url: "/dp/device/list",
    method: "get"
    // data: data
  })
}

/**
 * 获取三环类所有数据的经纬度
 * @param query 
 * @returns 
 */
export const mapNoiseList = (query?: any) => {
  return request({
    url: "/dp/noiseMapList",
    method: "get",
    params: query
  })
}


/**
 * 获取三环类所有数据的经纬度的总数
 * @param query 
 * @returns 
 */
export const getMapNoiseTotal = (query?: any) => {
  return request({
    url: "/dp/noiseMapCount",
    method: "get",
    params: query
  })
}

/** 功能区相关 */

export const listDivide = (query?: any) => {
  return request({
    url: "/dp/domainDivide",
    method: "get",
    params: query
  })
}


/** 投诉相关 */

export const listComplainArea = (query?: any) => {
  return request({
    url: "/dp/getComplainArea",
    method: "get",
    params: query
  })
}



/** 获取站点类型 */
export const listStationType = () => {
  return request({
    url: "/dp/station/list",
    method: "get"
  })
}

/** 获取设备的最大噪音、最小噪音、采集效率 */
export const gatherNoiseData = (query?: any) => {
  return request({
    url: "/system/noiseData/gather",
    method: "get",
    params: query
  })
}



/**
 * 数据过程线
 * @param id
 */
export const getDataProcessLine = (query: any) => {
  return request({
    url: "/dp/dataProcessLine",
    method: "get",
    params: query
  })
}


/**
 * 同期对比
 * @param id
 */
export const getContemComparison = (query: any) => {
  return request({
    url: "/dp/contemporaneousComparison",
    method: "get",
    params: query
  })
}


/**
 * 多站对比
 * @param id
 */
export const getmultista = (query: any) => {
  return request({
    url: "/dp/multistationComparison",
    method: "get",
    params: query
  })
}

/** 获取站点列表 */
export const DeviceinfoList = () => {
  return request({
    url: "/dp/device/list",
    method: "get"
  })
}

/**
 * 抓拍告警
 * @param id
 */
export const getCapture = (query: any) => {
  return request({
    url: "/system/captureAlarm/list",
    method: "get",
    params: query
  })
}

// 查询OSS对象基于id串
export function listByIds(ossId: string | number): AxiosPromise<OssVO[]> {
  return request({
    url: "/resource/oss/listByIds/" + ossId,
    method: "get"
  })
}
